package com.zhc.dejingapi.controller;


import com.zhc.dejingapi.common.result.Result;
import com.zhc.dejingapi.entity.QingInjectionmoldsendworkdetailEntity;
import com.zhc.dejingapi.entity.query.QingInQuery;
import com.zhc.dejingapi.entity.vo.IdAndCode;
import com.zhc.dejingapi.service.QingInjectionmoldsendworkdetailService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zhc
 * @since 2024-10-07
 */
@RestController
@RequestMapping("/qing-injectionmoldsendworkdetail-entity")
@CrossOrigin
public class QingInjectionmoldsendworkdetailController {

    @Resource
    private QingInjectionmoldsendworkdetailService qingInjectionmoldsendworkdetailService;

    @PostMapping("/addSendWork")
    public Result addSendWork(@RequestBody List<QingInjectionmoldsendworkdetailEntity> qingIList){
        return qingInjectionmoldsendworkdetailService.addSendWork(qingIList);
    }

    @PostMapping("/updateSendWork")
    public Result updateSendWork(@RequestBody List<QingInjectionmoldsendworkdetailEntity> qingIList){
        return qingInjectionmoldsendworkdetailService.updateSendWork(qingIList);
    }


    @PostMapping("/deleteSendWork/{mainId}")
    public Result deleteSendWork(@PathVariable Long mainId){
        return qingInjectionmoldsendworkdetailService.deleteSendWork(mainId);
    }

    @PostMapping("/updateIdAndCode")
    public Result updateIdAndCode(@RequestBody IdAndCode idAndCode){
        return qingInjectionmoldsendworkdetailService.updateIdAndCode(idAndCode);
    }

    @PostMapping("/selectQingIn")
    public Result selectQingIn(@RequestBody QingInQuery qingInQuery){
        return qingInjectionmoldsendworkdetailService.selectQingIn(qingInQuery);
    }

    @PostMapping("/getJobList/{eId}")
    public List<QingInjectionmoldsendworkdetailEntity> getJobList(@PathVariable Long eId){
        return qingInjectionmoldsendworkdetailService.getJobList(eId);
    }

    @PostMapping("/getJob/{mainId}")
    public QingInjectionmoldsendworkdetailEntity getJob(@PathVariable Long mainId){
        return qingInjectionmoldsendworkdetailService.getInfoById(mainId);
    }
}
